Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unreleased JSON serialization code from the CLI #1366

Merged
merged 1 commit into from
Dec 9, 2024

Conversation

cdisselkoen
Copy link
Contributor

@cdisselkoen cdisselkoen commented Dec 9, 2024

Description of changes

Following comment by @john-h-kastner-aws here.

#1326 added some JSON serialization commands to the CLI that were not guarded by the protobufs experimental feature. These are due to be replaced by protobuf versions. The code added by #1326 has not yet been released, so we're free to make changes before it is released without worrying about breaking things. The immediate steps taken in this PR are to:

  1. move all of the related code behind the protobufs experimental feature, and also to flatten the module while we're here.
  2. Remove the JSON-serialization command, leaving just the protobuf-serialization commands.

Issue #, if available

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A change (breaking or otherwise) that only impacts unreleased or experimental code.

I confirm that this PR (choose one, and delete the other options):

  • Does not update the CHANGELOG because my change does not significantly impact released code.

I confirm that cedar-spec (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar formal model or DRT infrastructure.

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

  • Does not require updates because my change does not impact the Cedar language specification.

Comment on lines 121 to +124
/// Output a protobuf binary file for consumption by Lean
#[cfg(feature = "protobufs")]
#[command(subcommand)]
WriteDRTProto(serialization::AnalysisCommands),
WriteDRTProto(protobufs::AnalysisCommands),
Copy link
Contributor

@john-h-kastner-aws john-h-kastner-aws Dec 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question related to existing code, but worth thinking about before releaseing protbuf code. I guess I don't really know what protofbuf functionality was added to the CLI in the first place, but how does the variant name (WriteDRTProto) relate to inner struct (AnalysisCommands)? Also, is this protobuf format still DRT specific, or should we rename this to something more general before release?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming was done by #1326, I think the relationship is that AnalysisCommands is a list of the protobuf formats supported by WriteDRTProto (today, just Equivalence), all of which relate to analysis (at least today). I agree this should be changed prior to release. Let's track that in #1348; I see you've already linked this comment there

@cdisselkoen cdisselkoen merged commit 405f177 into main Dec 9, 2024
19 checks passed
@cdisselkoen cdisselkoen deleted the cdisselkoen/cli-unreleased branch December 9, 2024 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants